{include file="public_head" /}
<style>
    .table{
        background-color: #cafffa;
        margin-bottom: 0;
    }
</style>
<!-- datatables -->
<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!-- chk_3 -->
<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">

<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}

        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            商品规格管理
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">
                    <div class="x_content">




                        <!--</div>-->

                        <form class="title_left">

                            <div class="form-group pull-left top_search">





                                <!--<div class="input-group" style="float: left;margin: 0 20px;">-->



                                <!--<select name="promotion" class="select2_single" style="width: 200px;"-->

                                <!--tabindex="-1">-->

                                <!--<option value="0">- 请选择促销状态 -</option>-->

                                <!--<option value="1" {eq name=':input("promotion")' value='1' }selected{/eq}>启用</option>-->

                                <!--<option value="2" {eq name=':input("promotion")' value='2' }selected{/eq}>未启用</option>-->

                                <!--</select>-->

                                <!--</div>-->

                                <!--<div class="input-group" style="float: left;margin: 0 20px;">-->



                                <!--<select name="state" class="select2_single" style="width: 200px;"-->

                                <!--tabindex="-1">-->

                                <!--<option value="0">- 请选择上架状态 -</option>-->

                                <!--<option value="1" {eq name=':input("state")' value='1' }selected{/eq}>上架</option>-->

                                <!--<option value="2" {eq name=':input("state")' value='2' }selected{/eq}>下架</option>-->

                                <!--</select>-->

                                <!--</div>-->
                                <div class="input-group" style="float: left;margin: 0 20px;position: relative;z-index: 99999999">
                                    <form name="form" id="target" method="get" action="">
                                    <select name="shop_class_id" class="select2_single"  tabindex="-1" style="position: relative;z-index: 99999999">
                                        <option value="0">- 请选择栏目 -</option>

                                        {volist name='classify' id='shopClassData'}

                                        <option
                                                value="{$shopClassData.id}"
                                                {eq name=':input("shop_class_id")' value='$shopClassData.id'}
                                                selected
                                                {/eq}
                                        {neq name="shopClassData.count" value="3"}disabled{/neq}
                                        >
                                        {neq name="shopClassData.parenTid" value="0"}
                                        {:str_repeat('　',$shopClassData['count'])}
                                        {/neq}
                                        {eq name="shopClassData.parenTid" value="0"}
                                        <span>&nbsp;</span>
                                        {else /}
                                        <span>&nbsp;</span>
                                        {/eq}

                                        {neq name="shopClassData.count" value="1"}|&nbsp;--&nbsp;{/neq}
                                        {$shopClassData.title}
                                        </option>
                                        {/volist}
                                    </select>
                                </div>


                            </div>

                            <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索</button>
                        </form>

                        </div>
                    </div></form>
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <a style="float: right" href="{:url('ShopGoodsSpec/create')}"
                                   class="btn btn-success btn-sm">创建商品规格</a>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="post" action="">
                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <!--<th style="width: 2%; padding: 10px;">-->
                                                <!--<input type="checkbox" class="checkall"-->
                                                       <!--onclick="CheckAll(this.checked);"/>-->
                                            <!--</th>-->
                                            <th width="">ID</th>
                                            <th width="500">分类名称</th>
                                            <th width="">规格</th>
                                            <th width="">审核状态</th>
                                            <th width="">一级审核</th>
                                            <th width="">二级审核</th>
                                            <th width="">三级审核</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {empty name="data"}
                                            <tr><td colspan="8"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>
                                        {/empty}
                                        {volist name="data" id="item"}
                                        <tr>
                                            <!--<td align="center">-->
                                                <!--<input type="checkbox" name="id[]" value="{$item.id}"/>-->
                                            <!--</td>-->
                                            <td>{$item.id}</td>
                                            <td>{$item.cat_name}</td>
                                            <td width="400">{$item.title}</td>
                                            <td>{$item.auding_text}</td>
                                            <td>{$item.auding_text1}</td>
                                            <td>{$item.auding_text2}</td>
                                            <td>{$item.auding_text3}</td>
                                            <td>
                                                <a href="{:url('ShopGoodsSpec/attrList', ['attr_id' => $item['goods_type_id'],'id'=>$item['id']])}"
                                                   class="label label-warning">
                                                    <span class="fa fa-cog"></span>&nbsp;&nbsp;属性设置
                                                </a>

                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <a {notin name=":session('role_id')" value="11,12,13"}href="{:url('ShopGoodsSpec/update', ['id' => $item['id']])}"{else/}onclick="layer.msg('审核员只有审核权限')"{/notin}
                                                   class="label label-primary">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                </a>

                                        &nbsp;&nbsp;&nbsp;&nbsp;     {eq name="$auding_status" value="2"}
                                                <a {notin name=":session('role_id')" value="11,12,13"}href="{:url('ShopGoodsSpec/destroy', ['id' => $item['id']])}" onClick="return confirm('系统会自动删除类别下所有子类别，确定删除吗?')"{else/} onclick="layer.msg('审核员只有审核权限')" {/notin}
                                                   class="label label-danger"
                                                >
                                                    <span class="fa fa-times"></span>&nbsp;&nbsp;删 除
                                                </a>
                                            &nbsp;&nbsp;&nbsp;&nbsp;{neq name="$item.auding_status" value="2"}
                                                <a href="{:url('ShopGoodsSpec/update', ['id' => $item['id']])}"
                                                   class="label label-success">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;审 核
                                                </a>
                                                {else/}
                                                <a
                                                        class="label label-warning">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;完 成
                                                </a>
                                                {/neq}
                                                {/eq}
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                        <tbody align="left">
                                        <tr>

                                        </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <!-- /page content -->
    </div>

</div>

{include file="public_foot" /}
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<script type="text/javascript">
    // list
    $(document).ready(function () {
        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
    });
    function dc() {
        var state = {:input('state',0)};
        var shop_class_id = "{:input('shop_class_id')}";
        var title = "{:input('title')}";
        window.location.href= "{:url('index')}?export=e&pa=10000&state="+state+'&shop_class_id='+shop_class_id+'&title='+title;
    }
</script>